package com.sxpi.chapter02.oracle;

import com.sxpi.chapter02.mode.IDataSource;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

import javax.sql.DataSource;

/**
 * @Author: 董伟豪
 * @Date: 2023/2/5 11:15
 */
public class OracleHikariCPDataSource implements IDataSource {

    @Override
    public DataSource dataSource() {

        HikariConfig hikariConfig = new HikariConfig();
        hikariConfig.setJdbcUrl("jdbc:mysql://localhost:3306/kss-web-db");
        hikariConfig.setUsername("root");
        hikariConfig.setPassword("dp899556677");
        hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
        HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);
        return hikariDataSource;

    }
}
